{extend name="public:base"}
{block name="right"}
    <a href="{:url('actioninfo')}" class="layui-btn layui-btn-normal head-right">添加操作</a>
{/block}
{block name="main"}
<div class="layui-form">
  条件搜索：
  <div class="layui-inline">
    <input class="layui-input" name="keyword" id="keyword"  placeholder="请输入关键字">
  </div>
  <div class="layui-inline">
    <input class="layui-input" name="start" id="start"  placeholder="请输入开始时间">
  </div>
  <div class="layui-inline">
    <input class="layui-input" name="end" id="end"  placeholder="请输入结束时间">
  </div>
  
  <button class="layui-btn" data-type="reload" lay-filter="submit" lay-submit>搜索</button>
  <button class="layui-btn layui-btn-primary" type="reset" data-type="reload" lay-filter="reset" lay-submit>重置</button>

</div>
<table class="layui-table" lay-data="{height:500,url:'{:Url('loglist')}', page:true, id:'videolist'}" lay-filter="table">
  <thead>
    <tr>
      <th lay-data="{field:'logid', width:80, sort: true}">ID</th>
      <th lay-data="{field:'name', width:150}">管理员名称</th>
      <th lay-data="{field:'content', width:250}">日志</th>
      <th lay-data="{field:'addtime', width:180, sort: true}">添加时间</th>
    </tr>
  </thead>
</table>


<script>
layui.use(['table'], function(){
  
  //搜索
  form.on('submit(submit)', function(data){

    var start=$("input[name='start']").val();
    var end=$("input[name='end']").val();
    var keyword=$("input[name='keyword']").val();
    table.reload('videolist', {
    where: { 
      keyword:keyword,
      start:start,
      end:end
    }
  });

    return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
  });

  //重置
  form.on('submit(reset)', function(data){

    $("input").val("");
    table.reload('videolist', {
      where: { 
        keyword:""
      }
    });
    return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
  });


});

</script>
{/block}